In [ ]:
from astropy.table import Table
from astropy.io import ascii, fits
import astropy.coordinates as coord
import astropy.units as u
import numpy as np
import matplotlib.pyplot as pl
pl.style.use('apw-notebook')
%matplotlib inline
import pandas as pd

In [ ]:
kepler = Table(np.genfromtxt("../data/kepler-eb.csv", delimiter=",", names=True, dtype=None, skip_header=7))

In [ ]:
apogee = Table(fits.getdata("/Users/adrian/Data/APOGEE_DR12/allStar-v603.fits", 1))

In [ ]:
kepler_c = coord.Galactic(l=kepler['GLon']*u.degree, b=kepler['GLat']*u.degree)
apogee_c = coord.Galactic(l=apogee['GLON']*u.degree, b=apogee['GLAT']*u.degree)

In [ ]:
idx,sep,_ = coord.match_coordinates_sky(kepler_c, apogee_c)

In [ ]:
len(apogee)

In [ ]:
match = kepler[sep < 3.*u.arcsecond]

In [ ]:
match

In [ ]:
period_idx = (match['period'] < 250) & (match['period'] > 75)
period_idx.sum()

In [ ]:
match[period_idx]

In [ ]:
match[match['KIC'] == 9246715]

In [ ]:
coord.Galactic(l=80.7927*u.degree, b=7.6115*u.degree).transform_to(coord.ICRS)

Stars in APOGEE with similar T_eff


In [ ]:
similar = apogee[((apogee['TEFF'] > 4690) & (apogee['TEFF'] < 4710))]
similar = similar[(similar['LOGG'] > 2.4) & (similar['LOGG'] < 2.6)]

In [ ]:
pl.hist(similar['LOGG'], bins=32);

In [ ]:
similar[0]['APOGEE_ID']

In [ ]:


In [ ]: